# -*- coding: utf-8 -*-
"""
Created on Thu Apr 23 08:43:36 2015

@author: ba0hx
"""

import pandas as pd
from scipy import stats as ss
#df = pd.read_csv('d.csv')
data_url = "https://raw.githubusercontent.com/alstat/Analysis-with-Programming/master/2014/Python/Numerical-Descriptions-of-the-Data/data.csv"
df = pd.read_csv(data_url)
print df.head()
print df.tail()
print df.columns
print df.index
print df.T
print df.ix[:, 0].head()
print df.ix[10:20, ['Abra', 'Apayao', 'Benguet']]
print df.drop(df.columns[[1, 2]], axis = 1).head()
print df.describe()
print ss.ttest_1samp(a = df.ix[:, 'Abra'], popmean = 15000)
print ss.ttest_1samp(a = df, popmean = 15000)

import matplotlib.pyplot as plt
plt.show(df.plot(kind = 'box'))
pd.options.display.mpl_style = 'default'
df.plot(kind = 'box')

import seaborn as sns
plt.show(sns.boxplot(df, widths = 0.5, color = "pastel"))
plt.show(sns.violinplot(df, widths = 0.5, color = "pastel"))
plt.show(sns.distplot(df.ix[:,2], rug = True, bins = 15))
with sns.axes_style("white"):
    plt.show(sns.jointplot(df.ix[:,1], df.ix[:,2], kind = "kde"))
plt.show(sns.lmplot("Benguet", "Ifugao", df))
